package cate.game.role.bag.item.msg;

import cate.common.table.d.GDObj;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBBag;
import cate.game.role.Role;
import easy.java.dev.note.NoteField;

import java.util.HashMap;
import java.util.Map;

@ClientMsg(title = "背包扩容 の 返回")
public class BagCapacityResp implements MsgOutput {

    @NoteField(value = "各背包的容量", detail = "Map<背包类型, 容量>")
    public Map<Byte, Integer> capacity;

    @NoteField(value = "各背包的扩容次数", detail = "Map<背包类型, 扩容次数>")
    public Map<Byte, Integer> expandTimes;

    public BagCapacityResp(){

    }

    public BagCapacityResp(Role role) {
        capacity = new HashMap<>();
        capacity.put(GDObj.Type.HERO, role.getBag().hero.getCapacity());

        expandTimes = new HashMap<>();
        expandTimes.put(GDObj.Type.HERO, role.getBag().hero.getExpandTimes());
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBBag.CAPACITY_RESP;
    }
}
